export function MyStack(){
    var o={};
    o.array=[];
    o.MySize=Number(0);
    o.push=function (val){
        o.array[o.MySize]=val;
        o.MySize+=1;
    }
    o.size=function (){
        return o.MySize;
    }
    o.isEmpty=function (){
        return o.MySize === 0;
    }
    o.pop=function (){
        if(o.MySize===0)
            return null
        o.MySize-=1;
        return o.array[o.MySize]
    }
    o.peek=function (){
        if(o.MySize===0)
            return null;
        return o.array[o.MySize-1]
    }
    return o
}
